package cn.edu.qut.edusys.controller;

import cn.edu.qut.edusys.mapper.NewsMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/news")
public class newsController {

    @Resource
    private NewsMapper newsMapper;

    @RequestMapping("/list")
    public List<Map<String,Object>> list() {
        return newsMapper.list();
    }

    @RequestMapping("/info")
    public Map<String,Object> info(String id) {
        System.out.println(id);
        return newsMapper.info(id);
    }
}
